GBML manual / Camera

camera_y

Where the camera’s view begins, down: the y of the top edge of what the screen shows, counted from the room’s top-left corner.

Syntax

camera_y() -> real

Returns

real

Description

The camera's current vertical position - the counterpart to camera_x, for the same reasons: on-screen checks, parallax, anything that needs to know where the view actually is right now rather than where some instance is.

It gives the y where the view begins - the top edge of what the screen shows - counted from the room's top-left corner. A thing at world y appears on the screen at y - camera_y().

Example

var cy = camera_y();

Reads where the view begins, down, into a local variable.

See also: camera_x